class Player(object):
    numbers = 0  # 类属性

    def __init__(self, name, age, city):  # 初始化函数
        self.name = name  # 实例属性
        self.age = age
        self.city = city
        Player.numbers += 1

    def __str__(self):
        return self.city + self.name


tom1 = Player("tom1", 20, 'china')
tom2 = Player("tom2", 20, 'china')
print(Player.numbers)
